Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 v1beta2: implement VSphereCluster's Ready, FailureDomainsReady, ClusterModulesReady and VCenterAvailable conditions for govmomi #3396

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chrischdi
Copy link
Member

What this PR does / why we need it:

Implements the following v1beta2 conditions for govmomi mode's VSphereCluster

  • Ready
  • FailureDomainsReady
  • ClusterModulesReady
  • VCenterAvailable

Part of #3221

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 17, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from chrischdi. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from srm09 and vrabbi March 17, 2025 10:58
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 17, 2025
@chrischdi
Copy link
Member Author

/hold

For rebase after

merged

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2025
@chrischdi chrischdi mentioned this pull request Mar 17, 2025
9 tasks
@chrischdi chrischdi force-pushed the pr-govmomi-vspherecluster branch 3 times, most recently from c052885 to ed5924a Compare March 17, 2025 12:01
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2025
@chrischdi chrischdi force-pushed the pr-govmomi-vspherecluster branch from ed5924a to dd8d3d6 Compare March 17, 2025 12:10
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2025
@chrischdi chrischdi changed the title 🌱 [wip] v1beta2: implement VSphereCluster's Ready, FailureDomainsReady, ClusterModulesReady and VCenterAvailable conditions for govmomi 🌱 v1beta2: implement VSphereCluster's Ready, FailureDomainsReady, ClusterModulesReady and VCenterAvailable conditions for govmomi Mar 17, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 17, 2025
@chrischdi chrischdi force-pushed the pr-govmomi-vspherecluster branch from dd8d3d6 to 70e9fbb Compare March 17, 2025 12:23
@chrischdi
Copy link
Member Author

@chrischdi chrischdi force-pushed the pr-govmomi-vspherecluster branch from 70e9fbb to d219994 Compare March 17, 2025 12:42
),
)

if !v1beta2conditions.Has(clusterCtx.VSphereCluster, infrav1.VSphereClusterVCenterAvailableV1Beta2Condition) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering a little bit about this.
If the goal is to handle code paths where those conditions are not set after an upgrade, this could lead to a state where the condition is false and it is never moved to true, which is an issue.

What if instead, if the condition is missing, we set this condition to true if the vsphere cluster is ready, false otherwise

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, misinterpreted what was discussed :-)

Adjusting it to set them on ignore. The old summary only included VCenterAvailable, so we also will rely on that, and add the others with ignore.

@chrischdi chrischdi added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Mar 17, 2025
@chrischdi
Copy link
Member Author

/retest

Image pull failure while building kind image

…eady and VCenterAvailable v1beta2 conditions for govmomi
@chrischdi chrischdi force-pushed the pr-govmomi-vspherecluster branch from 8333790 to a88b513 Compare March 18, 2025 10:12
@k8s-ci-robot
Copy link
Contributor

@chrischdi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-vsphere-apidiff-main c9298c0 link false /test pull-cluster-api-provider-vsphere-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@sbueringer
Copy link
Member

Thx!

/lgtm

/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a4608be7aa736b22d9d981c501cc16451677f4fe

Comment on lines +66 to +82
// VSphereCluster's VCenterAvailable condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// VSphereClusterVCenterAvailableV1Beta2Condition documents the status of vCenter for a VSphereCluster.
VSphereClusterVCenterAvailableV1Beta2Condition = "VCenterAvailable"

// VSphereClusterVCenterAvailableV1Beta2Reason surfaces when the vCenter for a VSphereCluster is available.
VSphereClusterVCenterAvailableV1Beta2Reason = clusterv1.AvailableV1Beta2Reason

// VSphereClusterVCenterUnreachableV1Beta2Reason surfaces when the vCenter for a VSphereCluster is unreachable.
VSphereClusterVCenterUnreachableV1Beta2Reason = "VCenterUnreachable"

// VSphereClusterVCenterNotAvailableV1Beta2Reason surfaces when the vCenter for a VSphereCluster is not available.
VSphereClusterVCenterNotAvailableV1Beta2Reason = clusterv1.NotAvailableV1Beta2Reason

// VSphereClusterVCenterAvailableDeletingV1Beta2Reason surfaces when the VSphereCluster is being deleted.
VSphereClusterVCenterAvailableDeletingV1Beta2Reason = clusterv1.DeletingV1Beta2Reason
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should look into making this condition consistent across objects

case len(modErrs) == 0 && len(clusterModuleSpecs) > 0:
conditions.MarkTrue(clusterCtx.VSphereCluster, infrav1.ClusterModulesAvailableCondition)
default:
conditions.Delete(clusterCtx.VSphereCluster, infrav1.ClusterModulesAvailableCondition)
}
v1beta2conditions.Set(clusterCtx.VSphereCluster, metav1.Condition{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: why this is not after L188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants